/*
 * @Author: WangLi
 * @Date: 2021-07-22 09:58:55
 * @LastEditors: WangLi
 * @LastEditTime: 2021-07-25 09:06:26
 * @Description:
 */
import { canIUseGetUserProfile } from "../..//utils/version";
export const button = Behavior({
  externalClasses: ["hover-class"],
  properties: {
    id: String,
    businessId: Number,
    sessionFrom: String,
    sendMessageTitle: String,
    sendMessagePath: String,
    sendMessageImg: String,
    showMessageCard: Boolean,
    appParameter: String,
    ariaLabel: String,
    openType: String,
    getUserProfileDesc: String,
  },
  data: {
    canIUseGetUserProfile: canIUseGetUserProfile(),
  },
  methods: {
    onGetUserInfo(event) {
      this.triggerEvent("getuserinfo", event);
    },
    onContact(event) {
      this.triggerEvent("contact", event.detail);
    },
    onGetPhoneNumber(event) {
      this.triggerEvent("getphonenumber", event.detail);
    },
    onError(event) {
      this.triggerEvent("error", event.detail);
    },
    onLaunchApp(event) {
      this.triggerEvent("launchapp", event.detail);
    },
    onOpenSetting(event) {
      this.triggerEvent("opensetting", event.detail);
    },
  },
});
